package com.easyapi.common.contants;

/**
 * @author javadadi
 */
public interface MySQLConstants {
    /**
     * mysql--获取所有的数据库
     */
    static final String SHOW_ALL_DATABASES = "SELECT schema_name \n" +
            "FROM information_schema.schemata \n" +
            "WHERE schema_name NOT IN ('information_schema', 'mysql', 'performance_schema', 'sys') \n";
    /**
     * mysql--获取所有的表
     */
    static final String SHOW_ALL_TABLES = "SELECT table_name \n" +
            "FROM information_schema.tables \n" +
            "WHERE table_schema = '%s';\n" ;
    /**
     * mysql--获取表结构
     */
    static final String SHOW_TABLE_STRUCTURE = "SELECT column_name, data_type, is_nullable, column_default, column_key, extra\n" +
            "FROM information_schema.columns\n" +
            "WHERE table_schema = '%s' AND table_name = '%s';";
    /**
     * mysql--获取表注释
     */
    public static final String SHOW_TABLE_COMMENT = "SELECT table_name, table_comment\n" +
            "FROM information_schema.tables\n" +
            "WHERE table_schema = '%s' AND table_name = '%s';\n" ;
    /**
     * mysql--获取列注释
     */
    public static final String SHOW_COLUMN_COMMENT = "SELECT column_name, column_comment\n" +
            "FROM information_schema.columns\n" +
            "WHERE table_schema = '%s' AND table_name = '%s';" ;
    /**
     * mysql--获取表的所有键
     */
    public static final String SHOW_TABLE_KEYS = "SHOW KEYS FROM %s.%s;";

    /**
     * mysql--数据预览
     */
    public static final String SHOW_TABLE_DATA = "SELECT * FROM %s.%s LIMIT 20;";

    /**
     * 获取创建语句
     */
    public static final String SHOW_CREATE_TABLE = "SHOW CREATE TABLE `%s`.`%s`;";
}
